package easy;

public class Solution_1800 {

    public int maxAscendingSum(int[] nums) {
        int max = 0, sum = 0;
        for (int i = 0, pre = 0; i < nums.length; i++) {
            if (nums[i] <= pre) {
                max = Math.max(max, sum);
                sum = nums[i];
            } else {
                sum += nums[i];
            }
            pre = nums[i];
        }
        return Math.max(max, sum);
    }
}
